<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: huajie <banhuajie@163.com>
// +----------------------------------------------------------------------
namespace Admin\Controller;
use Admin\Model\AuthGroupModel;
use Think\Page;

/**
 * 后台内容控制器
 * @author huajie <banhuajie@163.com>
 */
class MailerController extends AdminController {

    public function index($search = null){
        $map['name|tel|info']   =   array('like', '%'.$search.'%');
        if ( isset($_GET['time-start']) || isset($_GET['time-end'])) {
            $map['create_time'] = array('between',strtotime($_GET['time-start']).','.strtotime($_GET['time-end']));
        }
        $list = $this->lists('Mailer',$map,'create_time DESC');
//        foreach($list as &$data){
//            $data['info'] = mb_substr($data['info'],0,20,'utf-8').'...';
//        }
        // 记录当前列表页的cookie
        Cookie('__forward__',$_SERVER['REQUEST_URI']);
        $this->assign('_list', $list);
        $this->meta_title = '留言管理';
        $this->display();
    }


}
